//
//  ProcessedOrserTVCell.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/10.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "ProcessedOrserTVCell.h"

@implementation ProcessedOrserTVCell


-(void)loadViews {
    self.provenanceLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"济南"];
    self.jiantouImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jiantou"]];
    self.destinationLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"北京 海淀"];

    self.leghtLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:11] withColor:[UIColor blackColor] withText:@"车长：22M"];
    self.volumeLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:11] withColor:[UIColor blackColor] withText:@"重量/体积：8880kg"];
    self.headImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"touxiangMN"]];

    self.nameLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:11] withColor:[UIColor blackColor] withText:@"小鲁班"];
    self.timeLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:11] withColor:[UIColor blackColor] withText:@"2018-02-03"];
    self.stateLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"运输中"];
    self.telButton = [UIButton buttonWithTitle:nil withImageName:@"gouwuche" withBGColor:[UIColor grayColor] Withlayer:NO];
    [self.telButton addTarget:self action:@selector(telButtonC:) forControlEvents:UIControlEventTouchUpInside];
    self.confirmBut = [UIButton buttonWithTitle:@"确认收货" withImageName:nil withBGColor:[UIColor colorWithRed:106/255.0 green:181/255.0 blue:231/255.0 alpha:1] Withlayer:NO];
    [self.confirmBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.confirmBut.titleLabel.font = [UIFont systemFontOfSize:13];
    self.confirmBut.layer.cornerRadius = 5;
    [self.confirmBut addTarget:self action:@selector(confirmButtonC:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.provenanceLabel];
    [self addSubview:self.jiantouImage];
    [self addSubview:self.destinationLabel];
    [self addSubview:self.leghtLabel];
    [self addSubview:self.volumeLabel];
    [self addSubview:self.headImage];
    [self addSubview:self.nameLabel];
    [self addSubview:self.timeLabel];
    [self addSubview:self.stateLabel];
    [self addSubview:self.telButton];
    [self addSubview:self.confirmBut];
    
    
}
-(void)layoutViews{
    [self.provenanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(10));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.provenanceLabel.mas_width);
    }];
    [self.jiantouImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.provenanceLabel.mas_right).offset(GTFixWidthFlaot(5));
        make.top.mas_equalTo(GTFixHeightFlaot(15));
        make.height.mas_equalTo(GTFixHeightFlaot(10));
        make.width.mas_equalTo(GTFixHeightFlaot(20));
    }];
    [self.destinationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.jiantouImage.mas_right).offset(GTFixWidthFlaot(5));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.destinationLabel.mas_width);
    }];
    [self.leghtLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(10));
        make.top.mas_equalTo(self.provenanceLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.leghtLabel.mas_width);
    }];
    [self.volumeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.leghtLabel.mas_right).offset(GTFixWidthFlaot(5));
        make.top.mas_equalTo(self.provenanceLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.volumeLabel.mas_width);
    }];
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(10));
        make.top.mas_equalTo(self.leghtLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(40));
        make.width.mas_equalTo(GTFixHeightFlaot(40));
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImage.mas_right).offset(GTFixWidthFlaot(3));
        make.top.mas_equalTo(self.leghtLabel.mas_bottom).offset(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.nameLabel.mas_width);
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImage.mas_right).offset(GTFixWidthFlaot(3));
        make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(GTFixHeightFlaot(2));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.timeLabel.mas_width);
    }];
    [self.stateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-10));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(15));
        make.width.mas_equalTo(self.stateLabel.mas_width);
    }];
    [self.telButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-10));
        make.top.mas_equalTo(self.stateLabel.mas_bottom).offset(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(25));
        make.width.mas_equalTo(GTFixHeightFlaot(25));
    }];
    [self.confirmBut mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(GTFixWidthFlaot(-10));
        make.top.mas_equalTo(self.telButton.mas_bottom).offset(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(GTFixWidthFlaot(50));
    }];
}

-(void)telButtonC:(UIButton *)btn {
    
}
-(void)confirmButtonC:(UIButton *)btn {
    
}
@end
